home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung (Tewi)(1994).iso
/
assemblr
/
library
/
coreaids
/
pushall.asm
< prev
next >
Wrap
Assembly Source File
|
1987-06-25
|
1KB
|
53 lines
; DESC: Push all registers (AX,BX,CX,DX,DS,ES,BP,DI,SI) V1.00
; SAMPLE: PUSHALL
; ##################################################################
PSH_POPS Segment Para Common 'DATA'
DW 180 DUP(0)
PSH_POPS Ends
PUSHALLC Segment
Assume CS:PUSHALLC,DS:NOTHING,ES:PSH_POPS
Public PUSHALL
;notice.
DB 'PUSHALL - V1.00, Copyright 1987, CoreTechs ',0DH,0AH
PUSHALL Proc Near
Pop CS:WORD PTR[8] ;store return address to
;calling procedure.
Pop CS:WORD PTR[4] ;store return address to
;procedure calling procedure.
Push CS:WORD PTR[4] ;restore addresses.
Push CS:WORD PTR[8]
Mov CS:WORD PTR[0],SP ;save stack pointer and
Mov CS:WORD PTR[2],SS ;stack segment.
Mov SP,PSH_POPS ;load new stack segment
Mov SS,SP ;for temporary storage of all
Mov SP,CS:WORD PTR[6] ;registers.
Push CS:WORD PTR[4] ;save main return address.
Push AX ;save all registers on
Push BX ;alternate stack.
Push CX
Push DX
Push DS
Push ES
Push BP
Push DI
Push SI
Mov CS:WORD PTR[6],SP ;store top of stack pointer.
Mov SP,CS:WORD PTR[0] ;recover old stack.
Mov SS,CS:WORD PTR[2]
Ret 2 ;return to caller and dump
;additional return.
PUSHALL Endp
PUSHALLC Ends
End